package cn.edu.cug.cs.gtl.docsrv.dict.service;

import cn.edu.cug.cs.gtl.docsrv.dict.response.PaginatedValues;
import cn.edu.cug.cs.gtl.docsrv.dict.response.TableResponse;
import cn.edu.cug.cs.gtl.mybatis.mapper.dict.DictColInfo;
import cn.edu.cug.cs.gtl.protos.TableInfo;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface TableService {
    TableResponse getTableData(String tableName, Integer pageNum,
                                      Integer pageSize) throws Exception;

    PaginatedValues<Map> getTableDataV1(String tableName, Integer pageNum,
                                        Integer pageSize) throws Exception;

    List<Map> getTableStructureV1(String tableName) throws Exception;

    List<DictColInfo> getTableStructure(String tableName) throws Exception;

    TableInfo getTableInfo(String tableName) throws Exception;


    void addTableData(String tableName, List<Map> columnList) throws Exception;

    void deleteTableData(String tableName, List<Map> columnList) throws Exception;

    void updateTableData(String tableName, List<Map> columnList) throws Exception;

    void downloadTableBlobData(String tableName, String columnName, List<Map> columnList, HttpServletResponse response) throws Exception;

}
